* progmodes/python.el (python-shell-output-filter): Handle extra
authorFabián Ezequiel Gallina <fabian@anue.biz>
Mon, 8 Oct 2012 21:51:02 +0000 (18:51 -0300)
committerFabián Ezequiel Gallina <fabian@anue.biz>
Mon, 8 Oct 2012 21:51:02 +0000 (18:51 -0300)
carriage return in OSX.

lisp/ChangeLog
lisp/progmodes/python.el

index 982d27ec79b36da9246e0a5f7ad8447cd9454ed8..ad1a6c3bbc1558e01d3e0f9a7cbae664bdebabf7 100644 (file)
@@ -1,3 +1,8 @@
+2012-10-08  Fabián Ezequiel Gallina  <fgallina@cuca>
+
+       * progmodes/python.el (python-shell-output-filter): Handle extra
+       carriage return in OSX (Bug#12409).
+
 2012-10-08  Fabián Ezequiel Gallina  <fgallina@cuca>
 
        Fix shell handling of unbalanced quotes and parens in output.
index d35dbc69a48f5073c9ec02ed98a60c7d1349e630..018d6a7a1f21ae407e68a142781ffad1505065d7 100644 (file)
@@ -1866,7 +1866,9 @@ detecting a prompt at the end of the buffer."
    python-shell-output-filter-buffer
    (concat python-shell-output-filter-buffer string))
   (when (string-match
-         (format "\n\\(?:%s\\|%s\\|%s\\)$"
+         ;; XXX: It seems on OSX an extra carriage return is attached
+         ;; at the end of output, this handles that too.
+         (format "\r?\n\\(?:%s\\|%s\\|%s\\)$"
                  python-shell-prompt-regexp
                  python-shell-prompt-block-regexp
                  python-shell-prompt-pdb-regexp)